namespace QMVnSoft.SystemForms
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormDmCtEditor7 : FormListEditor
    {
        private IContainer components;
        private GBoxControl gBoxIn_Ct;
        private GBoxControl gBoxNumbering;
        private GBoxControl gBoxSo_Ct_Type;
        private GBoxControl gBoxTen_Ct;
        private LabelControl lblFreeFields;
        private LabelControl lblRepoFile;
        private LabelControl lblSeries;
        private LabelControl lblTen_Ct;
        private LabelControl lblTen_Ct_E;
        private LabelControl lblTitle;
        private LabelControl lblTitle_E;
        private RdioControl rdioControl1;
        private RdioControl rdioControl10;
        private RdioControl rdioControl2;
        private RdioControl rdioControl3;
        private RdioControl rdioControl4;
        private RdioControl rdioControl6;
        private TextNumeric txtFreeFields;
        private TextControl txtRepoFile;
        private TextControl txtSeries;
        private TextControl txtTen_Ct;
        private TextControl txtTen_Ct_E;
        private TextControl txtTitle;
        private TextControl txtTitle_E;

        public FormDmCtEditor7()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormDmCtEditor7));
            this.gBoxTen_Ct = new GBoxControl();
            this.txtTen_Ct_E = new TextControl();
            this.lblTen_Ct_E = new LabelControl();
            this.txtTen_Ct = new TextControl();
            this.lblTen_Ct = new LabelControl();
            this.gBoxSo_Ct_Type = new GBoxControl();
            this.rdioControl4 = new RdioControl();
            this.rdioControl3 = new RdioControl();
            this.rdioControl2 = new RdioControl();
            this.rdioControl1 = new RdioControl();
            this.gBoxNumbering = new GBoxControl();
            this.rdioControl6 = new RdioControl();
            this.rdioControl10 = new RdioControl();
            this.gBoxIn_Ct = new GBoxControl();
            this.txtFreeFields = new TextNumeric();
            this.txtRepoFile = new TextControl();
            this.lblFreeFields = new LabelControl();
            this.lblRepoFile = new LabelControl();
            this.txtTitle_E = new TextControl();
            this.lblTitle_E = new LabelControl();
            this.txtTitle = new TextControl();
            this.lblTitle = new LabelControl();
            this.txtSeries = new TextControl();
            this.lblSeries = new LabelControl();
            this.gBoxTen_Ct.SuspendLayout();
            this.gBoxSo_Ct_Type.SuspendLayout();
            this.gBoxNumbering.SuspendLayout();
            this.gBoxIn_Ct.SuspendLayout();
            base.SuspendLayout();
            base.txtMa_Loai3.FirstFilter = "Type = 'TK3'";
            base.txtMa_Loai3.Location = new Point(0x1b6, 0x1f6);
            base.txtMa_Loai3.Size = new Size(0x9b, 20);
            base.txtMa_Loai3.TabIndex = 15;
            base.txtMa_Loai2.FirstFilter = "Type = 'TK2'";
            base.txtMa_Loai2.Location = new Point(280, 0x1f6);
            base.txtMa_Loai2.Size = new Size(0x9c, 20);
            base.txtMa_Loai2.TabIndex = 14;
            base.txtMa_Loai1.FirstFilter = "Type = 'TK1'";
            base.txtMa_Loai1.Location = new Point(0x7b, 0x1f6);
            base.txtMa_Loai1.Size = new Size(0x9b, 20);
            base.txtMa_Loai1.TabIndex = 13;
            base.lblPhan_Loai.Location = new Point(12, 0x1f9);
            this.gBoxTen_Ct.Controls.Add(this.txtTen_Ct_E);
            this.gBoxTen_Ct.Controls.Add(this.lblTen_Ct_E);
            this.gBoxTen_Ct.Controls.Add(this.txtTen_Ct);
            this.gBoxTen_Ct.Controls.Add(this.lblTen_Ct);
            this.gBoxTen_Ct.Font = new Font("Arial", 8.25f);
            this.gBoxTen_Ct.Location = new Point(12, 0x1c);
            this.gBoxTen_Ct.Name = "gBoxTen_Ct";
            this.gBoxTen_Ct.Size = new Size(0x24a, 0x49);
            this.gBoxTen_Ct.TabIndex = 0;
            this.gBoxTen_Ct.TabStop = false;
            this.gBoxTen_Ct.Text = "Tên chứng từ";
            this.txtTen_Ct_E.Anchor = AnchorStyles.None;
            this.txtTen_Ct_E.CheckTextSearched = false;
            this.txtTen_Ct_E.DisabledForeColor = Color.Blue;
            this.txtTen_Ct_E.Font = new Font("Arial", 8.25f);
            this.txtTen_Ct_E.Location = new Point(0x66, 0x2a);
            this.txtTen_Ct_E.MaxLength = 128;
            this.txtTen_Ct_E.Name = "txtTen_Ct_E";
            this.txtTen_Ct_E.OldValue = null;
            this.txtTen_Ct_E.Size = new Size(0x1de, 20);
            this.txtTen_Ct_E.TabIndex = 1;
            this.txtTen_Ct_E.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTen_Ct_E.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTen_Ct_E.Value = null;//manager.GetObject("txtTen_Ct_E.Value");
            this.lblTen_Ct_E.AutoSize = true;
            this.lblTen_Ct_E.Font = new Font("Arial", 8.25f);
            this.lblTen_Ct_E.Location = new Point(6, 0x2d);
            this.lblTen_Ct_E.Name = "lblTen_Ct_E";
            this.lblTen_Ct_E.Size = new Size(0x38, 14);
            this.lblTen_Ct_E.TabIndex = 0;
            this.lblTen_Ct_E.Text = "Tiếng Anh";
            this.txtTen_Ct.Anchor = AnchorStyles.None;
            this.txtTen_Ct.CheckTextSearched = false;
            this.txtTen_Ct.DisabledForeColor = Color.Blue;
            this.txtTen_Ct.Font = new Font("Arial", 8.25f);
            this.txtTen_Ct.Location = new Point(0x66, 20);
            this.txtTen_Ct.MaxLength = 128;
            this.txtTen_Ct.Name = "txtTen_Ct";
            this.txtTen_Ct.OldValue = null;
            this.txtTen_Ct.Size = new Size(0x1de, 20);
            this.txtTen_Ct.TabIndex = 0;
            this.txtTen_Ct.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTen_Ct.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTen_Ct.Value = null;//manager.GetObject("txtTen_Ct.Value");
            this.lblTen_Ct.AutoSize = true;
            this.lblTen_Ct.Font = new Font("Arial", 8.25f);
            this.lblTen_Ct.Location = new Point(6, 0x17);
            this.lblTen_Ct.Name = "lblTen_Ct";
            this.lblTen_Ct.Size = new Size(0x37, 14);
            this.lblTen_Ct.TabIndex = 0;
            this.lblTen_Ct.Text = "Tiếng Việt";
            this.gBoxSo_Ct_Type.Controls.Add(this.rdioControl4);
            this.gBoxSo_Ct_Type.Controls.Add(this.rdioControl3);
            this.gBoxSo_Ct_Type.Controls.Add(this.rdioControl2);
            this.gBoxSo_Ct_Type.Controls.Add(this.rdioControl1);
            this.gBoxSo_Ct_Type.Font = new Font("Arial", 8.25f);
            this.gBoxSo_Ct_Type.Location = new Point(12, 0xd0);
            this.gBoxSo_Ct_Type.Name = "gBoxSo_Ct_Type";
            this.gBoxSo_Ct_Type.OptionBox = true;
            this.gBoxSo_Ct_Type.Size = new Size(0x184, 0x43);
            this.gBoxSo_Ct_Type.TabIndex = 2;
            this.gBoxSo_Ct_Type.TabStop = false;
            this.gBoxSo_Ct_Type.Text = "Đ\x00e1nh số chứng từ";
            this.rdioControl4.AutoSize = true;
            this.rdioControl4.Font = new Font("Arial", 8.25f);
            this.rdioControl4.Location = new Point(0x9e, 0x2b);
            this.rdioControl4.Name = "rdioControl4";
            this.rdioControl4.Size = new Size(0x57, 0x12);
            this.rdioControl4.TabIndex = 3;
            this.rdioControl4.Text = "Theo số cuối";
            this.rdioControl4.UseVisualStyleBackColor = true;
            this.rdioControl3.AutoSize = true;
            this.rdioControl3.Font = new Font("Arial", 8.25f);
            this.rdioControl3.Location = new Point(0x9e, 0x13);
            this.rdioControl3.Name = "rdioControl3";
            this.rdioControl3.Size = new Size(0x4f, 0x12);
            this.rdioControl3.TabIndex = 2;
            this.rdioControl3.Text = "Theo tháng";
            this.rdioControl3.UseVisualStyleBackColor = true;
            this.rdioControl2.AutoSize = true;
            this.rdioControl2.Font = new Font("Arial", 8.25f);
            this.rdioControl2.Location = new Point(0x1a, 0x2b);
            this.rdioControl2.Name = "rdioControl2";
            this.rdioControl2.Size = new Size(0x48, 0x12);
            this.rdioControl2.TabIndex = 1;
            this.rdioControl2.Text = "Theo năm";
            this.rdioControl2.UseVisualStyleBackColor = true;
            this.rdioControl1.AutoSize = true;
            this.rdioControl1.Checked = true;
            this.rdioControl1.Font = new Font("Arial", 8.25f);
            this.rdioControl1.Location = new Point(0x1a, 0x13);
            this.rdioControl1.Name = "rdioControl1";
            this.rdioControl1.Size = new Size(0x3f, 0x12);
            this.rdioControl1.TabIndex = 0;
            this.rdioControl1.TabStop = true;
            this.rdioControl1.Text = "Li\x00ean tục";
            this.rdioControl1.UseVisualStyleBackColor = true;
            this.gBoxNumbering.Controls.Add(this.rdioControl6);
            this.gBoxNumbering.Controls.Add(this.rdioControl10);
            this.gBoxNumbering.Font = new Font("Arial", 8.25f);
            this.gBoxNumbering.Location = new Point(0x197, 0xd0);
            this.gBoxNumbering.Name = "gBoxNumbering";
            this.gBoxNumbering.OptionBox = true;
            this.gBoxNumbering.Size = new Size(0xbf, 0x43);
            this.gBoxNumbering.TabIndex = 3;
            this.gBoxNumbering.TabStop = false;
            this.gBoxNumbering.Text = "Tăng phần số";
            this.rdioControl6.AutoSize = true;
            this.rdioControl6.Font = new Font("Arial", 8.25f);
            this.rdioControl6.Location = new Point(0x18, 0x2b);
            this.rdioControl6.Name = "rdioControl6";
            this.rdioControl6.Size = new Size(0x48, 0x12);
            this.rdioControl6.TabIndex = 1;
            this.rdioControl6.Text = "Phần cuối";
            this.rdioControl6.UseVisualStyleBackColor = true;
            this.rdioControl10.AutoSize = true;
            this.rdioControl10.Checked = true;
            this.rdioControl10.Font = new Font("Arial", 8.25f);
            this.rdioControl10.Location = new Point(0x1a, 0x13);
            this.rdioControl10.Name = "rdioControl10";
            this.rdioControl10.Size = new Size(70, 0x12);
            this.rdioControl10.TabIndex = 0;
            this.rdioControl10.TabStop = true;
            this.rdioControl10.Text = "Phần đầu";
            this.rdioControl10.UseVisualStyleBackColor = true;
            this.gBoxIn_Ct.Controls.Add(this.txtSeries);
            this.gBoxIn_Ct.Controls.Add(this.lblSeries);
            this.gBoxIn_Ct.Controls.Add(this.txtFreeFields);
            this.gBoxIn_Ct.Controls.Add(this.txtRepoFile);
            this.gBoxIn_Ct.Controls.Add(this.lblFreeFields);
            this.gBoxIn_Ct.Controls.Add(this.lblRepoFile);
            this.gBoxIn_Ct.Controls.Add(this.txtTitle_E);
            this.gBoxIn_Ct.Controls.Add(this.lblTitle_E);
            this.gBoxIn_Ct.Controls.Add(this.txtTitle);
            this.gBoxIn_Ct.Controls.Add(this.lblTitle);
            this.gBoxIn_Ct.Font = new Font("Arial", 8.25f);
            this.gBoxIn_Ct.Location = new Point(12, 0x6b);
            this.gBoxIn_Ct.Name = "gBoxIn_Ct";
            this.gBoxIn_Ct.Size = new Size(0x24a, 0x5f);
            this.gBoxIn_Ct.TabIndex = 1;
            this.gBoxIn_Ct.TabStop = false;
            this.gBoxIn_Ct.Text = "In chứng từ";
            this.txtFreeFields.AllowNegative = false;
            this.txtFreeFields.Font = new Font("Arial", 8.25f);
            this.txtFreeFields.Location = new Point(0x215, 0x40);
            this.txtFreeFields.Name = "txtFreeFields";
            this.txtFreeFields.NumericScaleOnFocus = 0;
            this.txtFreeFields.NumericScaleOnLostFocus = 0;
            int[] bits = new int[4];
            this.txtFreeFields.NumericValue = new decimal(bits);
            this.txtFreeFields.OldValue = null;
            this.txtFreeFields.Size = new Size(0x2f, 20);
            this.txtFreeFields.TabIndex = 4;
            this.txtFreeFields.Text = "0";
            this.txtFreeFields.TextAlign = HorizontalAlignment.Right;
//            this.txtFreeFields.Value = null;//manager.GetObject("txtFreeFields.Value");
            this.txtFreeFields.ZeroIsShown = true;
            this.txtRepoFile.Anchor = AnchorStyles.None;
            this.txtRepoFile.CharacterCasing = CharacterCasing.Upper;
            this.txtRepoFile.CheckTextSearched = false;
            this.txtRepoFile.DisabledForeColor = Color.Blue;
            this.txtRepoFile.Font = new Font("Arial", 8.25f);
            this.txtRepoFile.Location = new Point(0x66, 0x40);
            this.txtRepoFile.MaxLength = 0x20;
            this.txtRepoFile.Name = "txtRepoFile";
            this.txtRepoFile.OldValue = null;
            this.txtRepoFile.Size = new Size(90, 20);
            this.txtRepoFile.TabIndex = 2;
            this.txtRepoFile.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtRepoFile.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtRepoFile.Value = null;//manager.GetObject("txtRepoFile.Value");
            this.lblFreeFields.AutoSize = true;
            this.lblFreeFields.Font = new Font("Arial", 8.25f);
            this.lblFreeFields.Location = new Point(0x1a9, 0x43);
            this.lblFreeFields.Name = "lblFreeFields";
            this.lblFreeFields.Size = new Size(0x66, 14);
            this.lblFreeFields.TabIndex = 0;
            this.lblFreeFields.Text = "Số trường phân loại";
            this.lblRepoFile.AutoSize = true;
            this.lblRepoFile.Font = new Font("Arial", 8.25f);
            this.lblRepoFile.Location = new Point(6, 0x43);
            this.lblRepoFile.Name = "lblRepoFile";
            this.lblRepoFile.Size = new Size(0x55, 14);
            this.lblRepoFile.TabIndex = 0;
            this.lblRepoFile.Text = "Mẫu chứng từ in";
            this.txtTitle_E.Anchor = AnchorStyles.None;
            this.txtTitle_E.CheckTextSearched = false;
            this.txtTitle_E.DisabledForeColor = Color.Blue;
            this.txtTitle_E.Font = new Font("Arial", 8.25f);
            this.txtTitle_E.Location = new Point(0x66, 0x2a);
            this.txtTitle_E.MaxLength = 128;
            this.txtTitle_E.Name = "txtTitle_E";
            this.txtTitle_E.OldValue = null;
            this.txtTitle_E.Size = new Size(0x1de, 20);
            this.txtTitle_E.TabIndex = 1;
            this.txtTitle_E.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTitle_E.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTitle_E.Value = null;//manager.GetObject("txtTitle_E.Value");
            this.lblTitle_E.AutoSize = true;
            this.lblTitle_E.Font = new Font("Arial", 8.25f);
            this.lblTitle_E.Location = new Point(6, 0x2d);
            this.lblTitle_E.Name = "lblTitle_E";
            this.lblTitle_E.Size = new Size(0x5b, 14);
            this.lblTitle_E.TabIndex = 0;
            this.lblTitle_E.Text = "Ti\x00eau đề tiếng Anh";
            this.txtTitle.Anchor = AnchorStyles.None;
            this.txtTitle.CheckTextSearched = false;
            this.txtTitle.DisabledForeColor = Color.Blue;
            this.txtTitle.Font = new Font("Arial", 8.25f);
            this.txtTitle.Location = new Point(0x66, 20);
            this.txtTitle.MaxLength = 128;
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.OldValue = null;
            this.txtTitle.Size = new Size(0x1de, 20);
            this.txtTitle.TabIndex = 0;
            this.txtTitle.UserTextLength = AppInstance.TextControlLength.ItemDescription;
            this.txtTitle.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtTitle.Value = null;//manager.GetObject("txtTitle.Value");
            this.lblTitle.AutoSize = true;
            this.lblTitle.Font = new Font("Arial", 8.25f);
            this.lblTitle.Location = new Point(6, 0x17);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(90, 14);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "Ti\x00eau đề tiếng Việt";
            this.txtSeries.Anchor = AnchorStyles.None;
            this.txtSeries.CharacterCasing = CharacterCasing.Upper;
            this.txtSeries.CheckTextSearched = false;
            this.txtSeries.DisabledForeColor = Color.Blue;
            this.txtSeries.Font = new Font("Arial", 8.25f);
            this.txtSeries.Location = new Point(0x11d, 0x40);
            this.txtSeries.MaxLength = 0x20;
            this.txtSeries.Name = "txtSeries";
            this.txtSeries.OldValue = null;
            this.txtSeries.Size = new Size(0x59, 20);
            this.txtSeries.TabIndex = 3;
            this.txtSeries.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtSeries.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtSeries.Value = null;//manager.GetObject("txtSeries.Value");
            this.lblSeries.AutoSize = true;
            this.lblSeries.Font = new Font("Arial", 8.25f);
            this.lblSeries.Location = new Point(0xec, 0x43);
            this.lblSeries.Name = "lblSeries";
            this.lblSeries.Size = new Size(0x2b, 14);
            this.lblSeries.TabIndex = 4;
            this.lblSeries.Text = "Số hiệu";
            base.AddTitleText = "Khai báo tham số chứng từ";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(610, 0x218);
            base.Controls.Add(this.gBoxTen_Ct);
            base.Controls.Add(this.gBoxIn_Ct);
            base.Controls.Add(this.gBoxSo_Ct_Type);
            base.Controls.Add(this.gBoxNumbering);
            base.EditTitleText = "Khai báo tham số chứng từ";
            base.FirstFreeCode = "TK1";
            base.Name = "FormDmCtEditor7";
            base.SecondFreeCode = "TK2";
            base.ShowAddButton = false;
            base.ShowFreeFields = false;
            this.Text = "Khai báo tham số chứng từ";
            base.ThirdFreeCode = "TK3";
            base.Controls.SetChildIndex(this.gBoxNumbering, 0);
            base.Controls.SetChildIndex(this.gBoxSo_Ct_Type, 0);
            base.Controls.SetChildIndex(this.gBoxIn_Ct, 0);
            base.Controls.SetChildIndex(this.gBoxTen_Ct, 0);
            base.Controls.SetChildIndex(base.lblPhan_Loai, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai1, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai2, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai3, 0);
            this.gBoxTen_Ct.ResumeLayout(false);
            this.gBoxTen_Ct.PerformLayout();
            this.gBoxSo_Ct_Type.ResumeLayout(false);
            this.gBoxSo_Ct_Type.PerformLayout();
            this.gBoxNumbering.ResumeLayout(false);
            this.gBoxNumbering.PerformLayout();
            this.gBoxIn_Ct.ResumeLayout(false);
            this.gBoxIn_Ct.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public override bool OnSave()
        {
            if (string.IsNullOrEmpty(this.txtTen_Ct.Text))
            {
                MessageBox.Show("Chưa nhập tên chứng từ!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (string.IsNullOrEmpty(this.txtTen_Ct_E.Text))
            {
                MessageBox.Show("Chưa nhập tên tiếng Anh!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            if (string.IsNullOrEmpty(this.txtRepoFile.Text))
            {
                MessageBox.Show("Chưa nhập mẫu in chứng từ!", AppInstance.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return false;
            }
            base.LocalCurrentRow["Ten_Ct"] = this.txtTen_Ct.Value;
            base.LocalCurrentRow["Ten_Ct_E"] = this.txtTen_Ct_E.Value;
            base.LocalCurrentRow["Title"] = this.txtTitle.Value;
            base.LocalCurrentRow["Title_E"] = this.txtTitle_E.Value;
            base.LocalCurrentRow["RepoFile"] = this.txtRepoFile.Value;
            base.LocalCurrentRow["Series"] = this.txtSeries.Value;
            base.LocalCurrentRow["FreeFields"] = this.txtFreeFields.Value;
            base.LocalCurrentRow["So_Ct_Type"] = this.gBoxSo_Ct_Type.Value;
            base.LocalCurrentRow["Numbering"] = this.gBoxNumbering.Value;
            DmCtDataAccess access = new DmCtDataAccess();
            if (base.ShowMessage(base.LocalCurrentRow, access.SaveRow(base.NewChecked, base.LocalCurrentRow)))
            {
                return false;
            }
            base.LocalTable.AcceptChanges();
            return base.OnSave();
        }

        public override void OnShow()
        {
            this.txtTen_Ct.Value = base.LocalCurrentRow["Ten_Ct"];
            this.txtTen_Ct_E.Value = base.LocalCurrentRow["Ten_Ct_E"];
            this.txtTitle.Value = base.LocalCurrentRow["Title"];
            this.txtTitle_E.Value = base.LocalCurrentRow["Title_E"];
            this.txtRepoFile.Value = base.LocalCurrentRow["RepoFile"];
            this.txtSeries.Value = base.LocalCurrentRow["Series"];
            this.txtFreeFields.Value = base.LocalCurrentRow["FreeFields"];
            this.gBoxSo_Ct_Type.Value = Convert.ToInt16(base.LocalCurrentRow["So_Ct_Type"].ToString());
            this.gBoxNumbering.Value = Convert.ToInt16(base.LocalCurrentRow["Numbering"].ToString());
            base.OnShow();
        }
    }
}

